<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\AppendanceRep;
use Illuminate\Http\Request;

class Appendance extends Controller
{
    //考勤设置
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new AppendanceRep();
    }

    /**
     * 获取考勤设置列表
     */
    public function getAppendanceList(Request $request){
        $params = $request->all();
        $data = $this->rep->getAppendanceListRep($params);
        return re(0,$data,'success');
    }

    /**
     * 修改考勤设置
     */
    public function updateAppendance(Request $request){
        $params = $request->all();
        $data = $this->rep->updateAppendanceRep($params);
        return re(0,$data,'success');
    }

    /**
     * 获取请假列表
     */
    public function getLeaveList(Request $request){
        $params = $request->all();
        $data = $this->rep->getLeaveListRep($params);
        return re(0,$data,'success');
    }

    /**
     * 添加，编辑请假条
     */
    public function createLeave(Request $request){
        $params = $request->all();
        $data = $this->rep->createLeaveRep($params);
        return re(0,$data,'success');
    }

    /**
     * 删除请假条
     */
    public function delLeave(Request $request){
        $params = $request->all();
        $data = $this->rep->delLeaveRep($params);
        return re(0,$data,'success');
    }

}
